/*
Name: Kabir Kang
File: unittest2.c
Date: 7/13/14
Summary: tets the numHandCards() function
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

int main(int argc, char *argv[]){

  srand(time(NULL));
  int seed = rand()%11;
  int numPlayer = 2;
  int tests = 10;
  int i, count, countTest;
  int k[10] = {council_room, great_hall, feast, gardens, mine, remodel, smithy, adventurer, baron, village};
  struct gameState g;
  
  memset(&g, 0, sizeof(struct gameState));
  initializeGame(numPlayer, k, seed, &g);

  for(i=0;i<tests;i++)
    {
      countTest = rand()%10;
      g.handCount[0] = countTest;
      printf("%d cards \n",countTest);
      
      count = numHandCards(&g);
      if(count==countTest)
	{
	  printf("numHandCards(): PASSES when testing return value for number of cards in hand. \n");
	}
      else
	{
	  printf("numHandCards(): FAILS when testing return value for number of cards in hand. \n");
	}
    }

  return 0;
}
